/*  -*- mode: c++; coding: utf-8; c-file-style: "stroustrup"; -*-

    Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
    This file is part of Intromit.

    Intromit is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Intromit is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Intromit.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "python_members.hh"

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int python_members::sample_static_int=-987;

python_members::python_members()
{
    sample_vector=(int*)calloc(4, sizeof(int));
    n_sample_vector=2;
    max_sample_vector=4;
    sample_int=-10;
    sample_unsigned=12;
    sample_short=-14;
    sample_ushort=16;
    sample_char=-18;
    sample_uchar=20;
    sample_float=-22.24;
    sample_double=26.28;
    sample_longlong=-32;
    sample_ulonglong=34;
    sample_charp=strdup("sample string");
    sample_const_charp="sample const string";
    strncpy(sample_char_array, "sample char array", 48);
    sample_double_array[0]=0.2;
    sample_double_array[1]=0.6;
    sample_double_array[2]=0.1;
    sample_bool=true;
}

python_members::~python_members()
{
    if(sample_vector) sample_vector=(int*)realloc(sample_vector, 0);
    n_sample_vector=max_sample_vector=0;

    if(sample_charp) free(sample_charp);
}
